package com.itheima.sh.user.feign.fallback;

import com.itheima.sh.pojo.Order;
import com.itheima.sh.user.feign.OrderApi;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:  Feign 对 Order远程调用 降级方法
 * @Version: V1.0
 */
@Component
public class OrderFeignFallback implements OrderApi {


    @Override
    public List<Order> findOrderByUserId(String username) {
        List<Order> orders = new ArrayList<>();

        Order order = new Order();
        order.setId("-1");
        order.setUsername("服务器维护中");

        orders.add(order);
        return orders;
    }


}
